import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
	return request({
		url: '/system/order/list',
		method: 'get',
		params: {
			orderType: 1,
			...query
		}
	})
}

// 查询订单详情
export function getOrder(orderId) {
	return request({
		url: '/system/order/' + orderId,
		method: 'get'
	})
}

// 新增订单
export function addOrder(data) {
	return request({
		url: '/system/order',
		method: 'post',
		data: data
	})
}

// 修改订单
export function updateOrder(data) {
	return request({
		url: '/system/order',
		method: 'put',
		data: data
	})
}

// 删除订单
export function delOrder(orderId) {
	return request({
		url: '/system/order/' + orderId,
		method: 'delete'
	})
}

// 下发订单至业务员
export function assignOrderToSalesman(data) {
	return request({
		url: '/system/order/assign/salesman',
		method: 'post',
		data: data
	})
}

// 订单置顶
export function topOrder(data) {
	return request({
		url: '/system/order/top',
		method: 'post',
		data: data
	})
}

// 订单物流发货
export function logisticsShipping(data) {
	return request({
		url: '/system/order/logistics/shipping',
		method: 'post',
		data: data
	})
}

// 订单物流取消-拦截
export function logisticsCancel(data) {
	return request({
		url: '/system/order/logistics/cancel',
		method: 'put',
		data: data
	})
}

// 订单取消
export function cancelOrderX(data) {
	return request({
		url: '/system/order/cancel',
		method: 'post',
		data: data
	})
}